-
Notifications
You must be signed in to change notification settings - Fork 25k
[scripts] Update generate-artifacts-executor script to account for optional output path
#54609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[scripts] Update generate-artifacts-executor script to account for optional output path
#54609
Conversation
…optional The argument for the output path was always optional. This wasn't reflected in types, however, so this was missed in two prior changes.
b64d3f9 to
397b02c
Compare
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D87456501. |
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. I left a few suggestions and a couple of questions.
...ages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js
Outdated
Show resolved
Hide resolved
...ages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js
Outdated
Show resolved
Hide resolved
| const relativeAppPath = | ||
| outputPath != null && outputPath.length > 0 | ||
| ? path.relative(outputPath, appPath) | ||
| : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if outputPath is not passed, the relativeAppPath is '.'?
Are we sure it is correct?
| const relativeReactNativeRootFolder = | ||
| outputPath != null && outputPath.length > 0 | ||
| ? path.relative(outputPath, REACT_NATIVE_PACKAGE_ROOT_FOLDER) | ||
| : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if outputPath is not passed, the relativeAppPath is '.'?
Are we sure it is correct?
packages/react-native/scripts/codegen/generate-artifacts-executor/index.js
Outdated
Show resolved
Hide resolved
| if (platform === 'android') { | ||
| return defaultOutputPathForAndroid(baseOutputPath); | ||
| return defaultOutputPathForAndroid( | ||
| baseOutputPath != null && baseOutputPath.length > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseOutputPath can't be null anymore here, right?
| if (platform === 'ios') { | ||
| return defaultOutputPathForIOS(baseOutputPath); | ||
| return defaultOutputPathForIOS( | ||
| baseOutputPath != null && baseOutputPath.length > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseOutputPath can't be null anymore here, right?
packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js
Outdated
Show resolved
Hide resolved
packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js
Outdated
Show resolved
Hide resolved
packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Riccardo Cipolleschi <[email protected]>
Summary:
The argument for the output path to this CLI has always been optional, but the types didn't reflect this, which caused a few regressions in recent changes (e.g. #53503)
We should default to the
projectRootas implied bycomputeOutputPath.Resolves #54473
Changelog:
[GENERAL] [FIXED] - Ensure codegen CLI supports unspecified
--outputPathargumentTest Plan:
react-native codegeninrn-tester